package com.czk.rdd.operator.transform

import org.apache.spark.{SparkConf, SparkContext}

/**
 * @Author:ChenZhangKun
 * @Date: 2021/12/9 10:36
 */
object Spark02_RDD_Operator_Transform_Test {
  def main(args: Array[String]): Unit = {
    val sparkConf = new SparkConf().setMaster("local[*]").setAppName("RDD")
    val sc = new SparkContext(sparkConf)

    val rdd = sc.textFile("D:\\java\\spark\\spark\\resource\\data\\apache.log")
    // 包裹新的rdd
    val mapRDD = rdd.map(
      line => {
        val datas = line.split(" ")
        // 返回数据，第六个
        datas(6)
      }
    )
    mapRDD.collect().foreach(println)
  }
}
